function s_out=gen_ortho(s_in,nt,nr)
%assume nt is 3

s_out=zeros(nt,4);
s_out(1,1)=s_in(1,1);
s_out(2,1)=s_in(2,1);
s_out(3,1)=s_in(3,1)/sqrt(2);
s_out(1,2)=-conj(s_in(2,1));
s_out(2,2)=conj(s_in(1,1));
s_out(3,2)=-s_in(3,1)/sqrt(2);
s_out(1,3)=conj(s_in(3,1))/sqrt(2);
s_out(2,3)=conj(s_in(3,1))/sqrt(2);
s_out(3,3)=.5* (-s_in(1,1) - conj(s_in(1,1)) + s_in(1,1) - conj(s_in(1,1)) );
s_out(1,4)=conj(s_in(3,1))/sqrt(2);
s_out(2,4)=-conj(s_in(3,1))/sqrt(2);
s_out(3,3)=.5* (s_in(1,1) - conj(s_in(1,1)) + s_in(1,1) + conj(s_in(1,1)) );





